/* 对账
 */

import { getRequest, postRequest, getDownload } from '@/lib/axios'

export const driverAccountApi = {
  // 司机交账列表
  queryList: (param) => {
    return getRequest('/account/driver_list', param)
  },
  // 司机交账明细
  getDetail: (param) => {
    return getRequest('/account/info', param)
  },
  // 司机每日交账列表
  queryUnpaidList: (param) => {
    return getRequest('/account/driver_unpaid_list', param)
  },
  // 订单列表
  queryUnpaidDetail: (param) => {
    return getRequest('/account/driver_unpaid_detail', param)
  },
  // 司机交账
  driverAccount: (param: { id: string }) => {
    return postRequest('/account/check', param)
  },
  // 动态获取司机对账统计数据
  accountStatistics: (param) => {
    return postRequest('/account/account_statistics', param)
  },
  // 审核订单
  reCheck: (params: { id: string | number; recheck_status: number }) => {
    return postRequest('/account/recheck', params)
  },
  // 导出
  exportXlsx: (param) => {
    return getDownload('/account/exportXlsx', param)
  }
}

export const accountApi = {
  // 司机对账列表
  queryAccountList: (param) => {
    return getRequest('/account/driver_list', param)
  },
  // 司机对账详情明细
  queryDeliveryList: (param) => {
    return getRequest('/delivery/list', param)
  },
  // 业务员对账详情明细
  querySalesmanList: (param) => {
    return getRequest('/account/salesman_list', param)
  },
  // 经销商对账详情明细
  queryDealerList: (param) => {
    return getRequest('/account/dealer_list', param)
  }
}
